//
//  NowChartViewController.m
//  Stock
//
//  Created by blacksun on 11-6-21.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "NowChartViewController.h"


@implementation NowChartViewController
@synthesize nowLabel;
@synthesize upLabel;
@synthesize label3;
@synthesize label4;


- (void)dealloc
{
    self.nowLabel = nil;
    self.upLabel = nil;
    self.label3 = nil;
    self.label4 = nil;
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

#pragma mark - OverWrite Parent
/*-(void)chartViewDidDisplay{
    if (isDownLoading) {
        return;
    }
    [super chartViewDidDisplay];
    if (!self.imageView.image ||![imageTime.longTime isEqualToString:remoteTimeStamp]) {
        NSString *imageUrl = [NSString stringWithFormat:@"%@stock/chart?id=%@&type=%@",kHostName,currentMyStock.uuid,chartType];
        NSLog(@"%@",imageUrl);
        [self.imageDownloader downLoadImageWithUrl:imageUrl];
        isDownLoading = YES;
    }
}*/

-(void)requestFinishedWithResult:(id)aResult andUserinfo:(NSDictionary *)aUserinfo{
    [super requestFinishedWithResult:aResult andUserinfo:aUserinfo];
    self.imageView.image = aResult;
    currentMyStock.tc = remoteTimeStamp;
    isDownLoading = NO;
}
-(void)requestFinishedwithError:(NSError *)aError andUserinfo:(NSDictionary *)aUserinfo{
    isDownLoading = NO;
}


#pragma mark - View lifecycle

- (void)viewDidLoad
{
    self.chartType = @"td";
    MyStock *remoteStock = [[StockContext shareInstance] findRemoteStockWithStockId:currentMyStock.uuid];
    self.remoteTimeStamp = remoteStock.tc;
    [super viewDidLoad];
    nowLabel.text = [currentMyStock.closingPrice stringValue];
    upLabel.text = currentMyStock.changedPrice;
    label3.text = currentMyStock.changedRate;
    label4.text = currentMyStock.turnoverMoney;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    self.nowLabel = nil;
    self.upLabel = nil;
    self.label3 = nil;
    self.label4 = nil;
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


@end
